package com.sskj.hhrt.market;

import com.sskj.base.utils.RxUtils;
import com.sskj.hhrt.BasePresenter;
import com.sskj.hhrt.api.Api;
import com.sskj.hhrt.api.ApiObserver;
import com.sskj.hhrt.message.data.NoticeDetail;


/**
 * @author Hey
 * Create at  2019/03/28
 */
class MessageDetailPresenter extends BasePresenter<MessageDetailActivity> {
    public void getNoticeDetail(String id) {
        Api.getInstance().getNoticeDetail(id)
                .compose(RxUtils.transform())
                .subscribe(new ApiObserver<NoticeDetail>(this, true) {
                    @Override
                    public void onSuccess(NoticeDetail data) {
                        mView.setNoticeDetail(data);
                    }

                    @Override
                    public void onError(Throwable e) {
                        super.onError(e);
                    }
                });
    }
}
